});
this._updateVisibility();
- Shell.util_wake_up_screen();
+ this.emit('wake-up-screen');
}
},
this._updateVisibility();
if (obj.sourceBox.visible)
- Shell.util_wake_up_screen();
+ this.emit('wake-up-screen');
},
_visibleChanged: function(source, obj) {
this._updateVisibility();
if (obj.sourceBox.visible)
- Shell.util_wake_up_screen();
+ this.emit('wake-up-screen');
},
_detailedChanged: function(source, obj) {
this._sources.delete(source);
},
});
+Signals.addSignalMethods(NotificationsBox.prototype);
const Arrow = new Lang.Class({
Name: 'Arrow',
this._lockScreenContents.add_actor(this._lockScreenContentsBox);
this._notificationsBox = new NotificationsBox();
+ this._wakeUpScreenId = this._notificationsBox.connect('wake-up-screen', Lang.bind(this, this._wakeUpScreen));
this._lockScreenContentsBox.add(this._notificationsBox.actor, { x_fill: true,
y_fill: true,
expand: true });
this._hasLockScreen = true;
},
+ _wakeUpScreen: function() {
+ this._onUserBecameActive();
+ this.emit('wake-up-screen');
+ },
+
_clearLockScreen: function() {
this._clock.destroy();
this._clock = null;
if (this._notificationsBox) {
+ this._notificationsBox.disconnect(this._wakeUpScreenId);
this._notificationsBox.destroy();
this._notificationsBox = null;
}
<signal name="ActiveChanged"> \
<arg name="new_value" type="b" /> \
</signal> \
+<signal name="WakeUpScreen" /> \
</interface> \
</node>';
screenShield.connect('active-changed', Lang.bind(this, function(shield) {
this._dbusImpl.emit_signal('ActiveChanged', GLib.Variant.new('(b)', [shield.active]));
}));
+ screenShield.connect('wake-up-screen', Lang.bind(this, function(shield) {
+ this._dbusImpl.emit_signal('WakeUpScreen', null);
+ }));
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(ScreenSaverIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/ScreenSaver');
(GdkPixbufDestroyNotify) g_free, NULL);
}
-/**
- * shell_util_wake_up_screen:
- *
- * Send a fake key event, resetting the IDLETIME counter and
- * causing gnome-settings-daemon to wake up the screen.
- */
-/* Shamelessly taken from gnome-settings-daemon/plugins/power/gpm-common.c */
-void
-shell_util_wake_up_screen (void)
-{
- static gboolean inited = FALSE;
- static KeyCode keycode1, keycode2;
- static gboolean first_keycode = FALSE;
-
- if (inited == FALSE) {
- keycode1 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_KEY_Alt_L);
- keycode2 = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_KEY_Alt_R);
- }
-
- gdk_error_trap_push ();
- /* send a left or right alt key; first press, then release */
- XTestFakeKeyEvent (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), first_keycode ? keycode1 : keycode2, True, CurrentTime);
- XTestFakeKeyEvent (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), first_keycode ? keycode1 : keycode2, False, CurrentTime);
- first_keycode = !first_keycode;
- gdk_error_trap_pop_ignored ();
-}
-
void
shell_util_cursor_tracker_to_clutter (MetaCursorTracker *tracker,
ClutterTexture *texture)
int height,
int rowstride);
-void shell_util_wake_up_screen (void);
-
void shell_util_cursor_tracker_to_clutter (MetaCursorTracker *tracker,
ClutterTexture *texture);